<?php

namespace app\backstage\validate;

use think\Validate;

class QaSendConfigValidate extends Validate
{
    protected $rule = [
        'id' => 'require|number|gt:0',
        'mobile_brand' => 'require|in:huawei,xiaomi,OPPO,vivo',
        //华为
        'HW_PUSH_SERVER' => 'require',
        'HW_TOKEN_SERVER' => 'require',
        'HW_FAST_APPID' => 'require',
        'HW_FAST_APPSECRET' => 'require',
        //小米
        'secret' => 'require',
        //OPPO
        'AppKey' => 'require',
        'MasterSecret' => 'require',
        //vivo
        'appId' => 'require',
        'appKey' => 'require',
        'appSecret' => 'require',
    ];


    protected $message = [

    ];

    protected $scene = [
        'setSendConfig' => ['id', 'mobile_brand'],
        'huawei' => ['HW_PUSH_SERVER', 'HW_TOKEN_SERVER', 'HW_FAST_APPID', 'HW_FAST_APPSECRET'],
        'xiaomi' => ['secret'],
        'OPPO' => ['AppKey', 'MasterSecret'],
        'vivo' => ['appKey', 'appSecret'],
    ];
}